

const { ccclass } = cc._decorator;
let tempVec2 = cc.v2();
@ccclass
export default class BaseEntity extends cc.Component{
    protected isPause: boolean = false;
    public gamePause(boo) {
        this.isPause = boo;
    }

    private _id: number = -1;
    public get ID() {
        return this._id;
    }
    
    public static nextVaildID: number = 1;
    /**
     *必须调用初始化
     * @memberof BaseEntity
     */
    public init() {
        this._id = BaseEntity.nextVaildID++;
    }

    protected _radius: number = 30;//包围盒半径
    public get radius() {
        return this._radius;
    }
    public set radius(value: number) {
        this._radius = value;
    }
    private _position:cc.Vec2 = cc.v2();
    public get position() {
        cc.Vec2.set(this._position, this.node.x, this.node.y);
        return this._position;
    }

    private _isTag: boolean = false;
    public get isTag(): boolean {
        return this._isTag;
    }
    public set isTag(value: boolean) {
        this._isTag = value;
    }

}
